import javax.swing.JLabel;


public class Zaehler extends Thread {
	private JLabel lable;
	private int zaehler;
	private boolean halt;
	
	public Zaehler(JLabel lable) {
		this.lable = lable;
	}
	
	public void run() {
		zaehler = 0; 
		while(!isInterrupted()) {
			if(!halt)
				zaehler++;
			lable.setText("" + zaehler);
			try {
				Thread.sleep(1000);
			} catch(InterruptedException e) {
				interrupt();
			}
		}
	}
	
	public void halt(boolean halt) {
		this.halt = halt;
	}
}
